﻿using MediatR;
using S.EliminationOrDath.API.Application.Command.SheepDeathCommand;
using S.EliminationOrDath.Infrastructure.Interface;

namespace S.EliminationOrDath.API.Application.CommandHandlers.SheepDeathCommandHandler
{
    public class SheepUpdAuditorTwoCommandHandler : IRequestHandler<SheepUpdAuditorTwoCommand, bool>
    {
        private readonly ISheepDeathRepository _sheepDeathRepository;
        public SheepUpdAuditorTwoCommandHandler(ISheepDeathRepository sheepDeathRepository)
        {
            _sheepDeathRepository= sheepDeathRepository;
        }
        /// <summary>
        /// 取消审核方法
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public async Task<bool> Handle(SheepUpdAuditorTwoCommand request, CancellationToken cancellationToken)
        {
            return await _sheepDeathRepository.UpdAuditorTow(request.DeathIds);
        }
    }
}
